package com.caxxb.service.impl;

import com.caxxb.dao.OrderDao;
import com.caxxb.dao.impl.OrderDaoImpl;
import com.caxxb.entity.Game;
import com.caxxb.entity.Order;
import com.caxxb.entity.OrderPojo;
import com.caxxb.service.OrderService;
import com.caxxb.util.PageData;

import java.util.List;

public class OrderServiceImpl implements OrderService {


    private OrderDao orderDao=new OrderDaoImpl();

    @Override
    public boolean addToOrder(Game game, int userid,String conversion_code) {
        return orderDao.addToOrder(game, userid,conversion_code);
    }

    @Override
    public PageData<OrderPojo> getOrdersByUserId(int userid, int pageNo, int pageSize) {
        return orderDao.getOrdersByUserId(userid, pageNo, pageSize);
    }

    @Override
    public PageData queryOrderByPage(int pageNo, int pageSize, String keywords) {
        return orderDao.queryOrderByPage(pageNo, pageSize, keywords);
    }

    @Override
    public List<Order> CheckOrderByUserId(int userid, int gameid) {
        return orderDao.CheckOrderByUserId(userid, gameid);
    }

    @Override
    public OrderPojo getOrderByOrderId(int orderid) {
        return orderDao.getOrderByOrderId(orderid);
    }

    @Override
    public boolean delOrderByOrderId(int orderid) {
        return orderDao.delOrderByOrderId(orderid);
    }
}